package pers.qtong.tank.strategy;

import pers.qtong.tank.Bullet;
import pers.qtong.tank.Dir;
import pers.qtong.tank.Tank;

import java.io.Serializable;

public class FourFireStrategy implements FireStrategy, Serializable {

    @Override
    public void fire(Tank tank) {
        int bx = tank.getX() + Tank.WIDTH / 2 - Bullet.width / 2;
        int by = tank.getY() + Tank.HEIGHT / 2 - Bullet.height / 2;
        for (Dir dir : Dir.values()) {
            new Bullet(bx, by, dir, tank.getGroup());
        }
    }
}